home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FM Towns: Free Software Collection 7
/
FM Towns Free Software Collection 7.iso
/
taropyon
/
guilib3
/
inc
/
cns
/
cnscf.h
Wrap
C/C++ Source or Header
|
1993-11-30
|
3KB
|
59 lines
#ifndef _CNSCF_H
#define _CNSCF_H
/* 画面内に表示可能な文字数を計算するマクロ */
#define CNS_DSPCNT(cns,_x,_y) { \
_x = (((cns)->tFr.x2-(cns)->tFr.x1+1) + ((cns)->fntX + (cns)->spcX - 1)) \
/ ((cns)->fntX + (cns)->spcX); \
_y = (((cns)->tFr.y2-(cns)->tFr.y1+1) + ((cns)->fntY + (cns)->spcY - 1)) \
/ ((cns)->fntY + (cns)->spcY); \
}
#define CNS_DSPDSP(cns,_x,_y) { \
_x = (((cns)->tFr.x2-(cns)->tFr.x1+1) + ((cns)->fntX + (cns)->spcX - 1)) \
/ ((cns)->fntX + (cns)->spcX); \
if ( ((cns)->tFr.x2 - (cns)->tFr.x1 + 1) % ((cns)->fntX + (cns)->spcX) ) \
--(_x); \
_y = (((cns)->tFr.y2-(cns)->tFr.y1+1) + ((cns)->fntY + (cns)->spcY - 1)) \
/ ((cns)->fntY + (cns)->spcY); \
if ( ((cns)->tFr.y2 - (cns)->tFr.y1 + 1) % ((cns)->fntY + (cns)->spcY) ) \
--(_y); \
}
#define CNSCOL_STR(cns) ((cns)->colTbl[ 0]) /* 文字 */
#define CNSCOL_BAC(cns) ((cns)->colTbl[ 1]) /* 背景 */
#define CNSCOL_SELSTR(cns) ((cns)->colTbl[ 2]) /* 選択中 */
#define CNSCOL_SELBAC(cns) ((cns)->colTbl[ 3])
#define CNSCOL_MKST(cns) ((cns)->colTbl[ 4]) /* マーク文字 */
#define CNSCOL_MKBK(cns) ((cns)->colTbl[ 5]) /* マーク背景 */
#define CNSCOL_TAB(cns) ((cns)->colTbl[ 6]) /* TAB */
#define CNSCOL_CRLF(cns) ((cns)->colTbl[ 7]) /* 改行 */
#define CNSCOL_CTRL(cns) ((cns)->colTbl[ 8]) /* 制御文字 */
#define CNSCOL_KS(cns) ((cns)->colTbl[ 9]) /* 全角スペース */
#define CNSCOL_MIFR(cns) ((cns)->colTbl[10]) /* 未表示エリア */
#define CNSCOL_MIBK(cns) ((cns)->colTbl[11]) /* 未表示エリア背景 */
#define CNSCOL_LNST(cns) ((cns)->colTbl[12]) /* 行番号文字 */
#define CNSCOL_LNBK(cns) ((cns)->colTbl[13]) /* 行番号背景 */
#define CNSCOL_CUR(cns) ((cns)->colTbl[14]) /* カーソル */
#define CNSCOL_CRUL(cns) ((cns)->colTbl[15]) /* カーソルアンダーライン */
#define CNSCOL_COST(cns) ((cns)->colTbl[16]) /* 桁位置ゲージ文字 */
#define CNSCOL_COBK(cns) ((cns)->colTbl[17]) /* 桁位置ゲージ背景 */
#define CNSCOL_FMST(cns) ((cns)->colTbl[18]) /* 検索マッチ文字 */
#define CNSCOL_FMBK(cns) ((cns)->colTbl[19]) /* 検索マッチ背景 */
#define CNSCOL_REST(cns) ((cns)->colTbl[20]) /* 矩形編集文字 */
#define CNSCOL_REBK(cns) ((cns)->colTbl[21]) /* 矩形編集文字 */
#define CNSCOL_FRAME(cns) ((cns)->colTbl[22]) /* 外枠(内部では使わない) */
#define CNSCOL_CNSSTR(cns) ((cns)->colTbl[30]) /* コンソール文字 */
#define CNSCOL_CNSBAC(cns) ((cns)->colTbl[31]) /* コンソール背景 */
extern void _cns_put12_spc( CNS_T *cns, int x, int y, int ch );
extern void _cns_put12_ank( CNS_T *cns, int x, int y, int ch );
extern void _cns_put12_kan( CNS_T *cns, int x, int y, int sjis);
extern void _cns_put16_spc( CNS_T *cns, int x, int y, int ch );
extern void _cns_put16_ank( CNS_T *cns, int x, int y, int ch );
extern void _cns_put16_kan( CNS_T *cns, int x, int y, int sjis);
#endif